]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
sessionMode: Add hasOverview property
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 16 May 2012 22:59:02 +0000 (00:59 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 22 May 2012 17:42:28 +0000 (19:42 +0200)
Add a sessionMode.hasOverview property, which determines whether
the mode should give access to the overview or not.

https://bugzilla.gnome.org/show_bug.cgi?id=676156

js/ui/main.js
js/ui/overview.js
js/ui/panel.js
js/ui/sessionMode.js

index b91ee4154acadd06308bd9aceece7b611988a440..247200a9c152da70af7b21f4a758e9e3deed55ef 100644 (file)
@@ -142,13 +142,6 @@ function _initUserSession() {
     Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
        getRunDialog().open();
     });
-
-    Meta.keybindings_set_custom_handler('panel-main-menu', function () {
-        overview.toggle();
-    });
-
-    global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
-
 }
 
 function start() {
@@ -212,8 +205,7 @@ function start() {
     layoutManager = new Layout.LayoutManager();
     xdndHandler = new XdndHandler.XdndHandler();
     ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
-    // This overview object is just a stub for non-user sessions
-    overview = new Overview.Overview({ isDummy: sessionMode.sessionType != Shell.SessionType.USER });
+    overview = new Overview.Overview();
     magnifier = new Magnifier.Magnifier();
     statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
     panel = new Panel.Panel();
@@ -236,6 +228,16 @@ function start() {
 
     if (sessionMode.sessionType == Shell.SessionType.USER)
         _initUserSession();
+
+    if (sessionMode.hasOverview) {
+        Meta.keybindings_set_custom_handler('panel-main-menu', function () {
+            overview.toggle();
+        });
+
+        global.display.connect('overlay-key',
+                               Lang.bind(overview, overview.toggle));
+    }
+
     statusIconDispatcher.start(messageTray.actor);
 
     // Provide the bus object for gnome-session to
index c1a4d5c0d71ecb4087bdedd8a1a2cefbb55f09a4..59dc71c42908ea4e089918b5e244ba7690a627bc 100644 (file)
@@ -99,10 +99,8 @@ const ShellInfo = new Lang.Class({
 const Overview = new Lang.Class({
     Name: 'Overview',
 
-    _init : function(params) {
-        params = Params.parse(params, { isDummy: false });
-
-        this.isDummy = params.isDummy;
+    _init : function() {
+        this.isDummy = !Main.sessionMode.hasOverview;
 
         // We only have an overview in user sessions, so
         // create a dummy overview in other cases
index ab00237f4d5ae6ce48252810d49d54126a585f87..45aabb218356afb9ee13841897b3b229015ac093 100644 (file)
@@ -962,7 +962,7 @@ const Panel = new Lang.Class({
         this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
 
         /* Button on the left side of the panel. */
-        if (Main.sessionMode.sessionType == Shell.SessionType.USER) {
+        if (Main.sessionMode.hasOverview) {
             this._activitiesButton = new ActivitiesButton();
             this._activities = this._activitiesButton.actor;
             this._leftBox.add(this._activities);
@@ -970,7 +970,9 @@ const Panel = new Lang.Class({
             // The activities button has a pretend menu, so as to integrate
             // more cleanly with the rest of the panel
             this._menus.addMenu(this._activitiesButton.menu);
+        }
 
+        if (Main.sessionMode.sessionType == Shell.SessionType.USER) {
             this._appMenu = new AppMenuButton(this._menus);
             this._leftBox.add(this._appMenu.actor);
         }
index 1ed5aaa21b1af302ae0e7b012be37ec0f42f0cbe..3ab89c18266c158450278f86e0aca114b3a65eaf 100644 (file)
@@ -8,9 +8,11 @@ const Params = imports.misc.params;
 const DEFAULT_MODE = 'user';
 
 const _modes = {
-    'gdm': { sessionType: Shell.SessionType.GDM },
+    'gdm': { hasOverview: false,
+             sessionType: Shell.SessionType.GDM },
 
-    'user': { sessionType: Shell.SessionType.USER }
+    'user': { hasOverview: true,
+              sessionType: Shell.SessionType.USER }
 };
 
 function modeExists(mode) {